/*
========================================================================
 Name        : Test9Container.h
 Author      : 
 Copyright   : Your copyright notice
 Description : 
========================================================================
*/
#ifndef TEST9CONTAINER_H
#define TEST9CONTAINER_H

// [[[ begin generated region: do not modify [Generated Includes]
#include <coecntrl.h>		
// ]]] end generated region [Generated Includes]


// [[[ begin [Event Handler Includes]
// ]]] end [Event Handler Includes]

// [[[ begin generated region: do not modify [Generated Forward Declarations]
class MEikCommandObserver;		
// ]]] end generated region [Generated Forward Declarations]

#include "Trip.h"
#include "SoundPlayer.h"
#include "Test9ContainerView.h"
#include "Test9ListBox.h"
#include "Test9ListBoxView.h"

/**
 * Container class for Test9Container
 * 
 * @class	CTest9Container Test9Container.h
 */
class CTest9Container : public CCoeControl
	{
public:
	// constructors and destructor
	CTest9Container();
	static CTest9Container* NewL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	static CTest9Container* NewLC( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	void ConstructL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	virtual ~CTest9Container();

public:
	// from base class CCoeControl
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl( TInt aIndex ) const;
	TKeyResponse OfferKeyEventL( 
			const TKeyEvent& aKeyEvent, 
			TEventCode aType );
	void HandleResourceChange( TInt aType );
	
protected:
	// from base class CCoeControl
	void SizeChanged();

private:
	// from base class CCoeControl
	void Draw( const TRect& aRect ) const;

private:
	void InitializeControlsL();
	void LayoutControls();
	CCoeControl* iFocusControl;
	MEikCommandObserver* iCommandObserver;
	// [[[ begin generated region: do not modify [Generated Methods]
public: 
	// ]]] end generated region [Generated Methods]
	
	// [[[ begin generated region: do not modify [Generated Type Declarations]
public: 
	// ]]] end generated region [Generated Type Declarations]
	
	// [[[ begin generated region: do not modify [Generated Instance Variables]
private: 
	// ]]] end generated region [Generated Instance Variables]
	
	
	// [[[ begin [Overridden Methods]
protected: 
	// ]]] end [Overridden Methods]
	
	
	// [[[ begin [User Handlers]
protected: 
	TKeyResponse HandleTest9ContainerOfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
	// ]]] end [User Handlers]
	
public: 
	enum TControls
		{
		// [[[ begin generated region: do not modify [Generated Contents]
		
		// ]]] end generated region [Generated Contents]
		
		// add any user-defined entries here...
		
		ELastControl
		};

private:
	bool AddLocation(const TDesC* aOverrideText = NULL, TDes* result = NULL);
	Path* path;
	Trip currentTrip;
	int ApplicationMode;
	const int NewTrip, BuildingPath;
	//CSoundPlayer *rightSound, *leftSound, *startSound;
	CTest9ContainerView* view;
	CTest9ListBoxView* loadView;
	bool IsPaused;
	bool IsUpkeyForward;	//UpKey may indicate moving forward OR moving backward
	
public:
	void PauseResumeSwitch();
	void UpKeyForwardBackwardSwitch();
	void StartNewTrip();
	void AddLocationInTrip();
	void SaveTrip();
	};
				
#endif // TEST9CONTAINER_H
